<style>
	.mpm-list-ico2 {
		color: #999;
		background: #fff;
		display: inline-block;
		padding: 2px;
		line-height: 12px;
		border: 1px solid #ccc;
	}
	.under-line {
		text-decoration: underline;
		color: rgb(41, 158, 236);
	}
</style>
<div class="col-sm-12 mt20">
	<div class="panel panel-default">
		<div class="panel-body">
			<div class="form-group ">
				<div class="col-sm-12">
					<div class="row">
						<div class="col-sm-2">
							<input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.name" ng-keyup="myKeyup($event)">
						</div>
						<div class="col-sm-2">
							<input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.code" ng-keyup="myKeyup($event)">
						</div>
						<div class="col-sm-2">
							<ui-select ng-model="searchform.place_code" theme="bootstrap" ng-keyup="myKeyup($event)">
								<ui-select-match placeholder="请选择一个场所">
									{{$select.selected.name}}
								</ui-select-match>
								<ui-select-choices repeat="item.code as item in viewarr | filter: $select.search">
									<span ng-bind-html="item.name | highlight: $select.search"></span>
								</ui-select-choices>
							</ui-select>
						</div>
						<div class="col-sm-2 ">
							<ui-select ng-model="searchform.sale_category" theme="bootstrap" ng-keyup="myKeyup($event)">
								<ui-select-match placeholder="产品分类">
									{{$select.selected.label}}
								</ui-select-match>
								<ui-select-choices repeat="item.value as item in dictbytypelist | filter: $select.search">
									<span ng-bind-html="item.label | highlight: $select.search"></span>
								</ui-select-choices>
							</ui-select>
						</div>
						<div class="col-sm-2 ">
							<ui-select ng-model="searchform.state" theme="bootstrap" ng-keyup="myKeyup($event)">
								<ui-select-match placeholder="产品状态">
									{{$select.selected.name}}
								</ui-select-match>
								<ui-select-choices repeat="item.value as item in statusArr | filter: $select.search">
									<span ng-bind-html="item.name | highlight: $select.search"></span>
								</ui-select-choices>
							</ui-select>
						</div>
						<div class="col-sm-2">
							<button type="submit" class="btn btn-info search  btn-block" ng-click="load()">立即搜索</button>
						</div>
					</div>
					<!--<div class="row mt10">
						<div class="col-sm-2 pull-right">
							<a class="btn btn-info  btn-block" ng-click="create()">创建产品</a>
						</div>
					</div>-->


				</div>
				<br/>
				<br/>
			</div>
			<div class="form-group">
				<div class="col-sm-12">
				</div>
			</div>
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-body">
			<div class="table-responsive">
				<table class="table table-condensed table-hover table-bordered">
					<thead>
						<tr>
							<th class="col-md-4 text-center">基本信息</th>
							<th class="col-md-2 text-center">价格</th>
							<th class="col-md-2 text-center">有效期</th>
							<th class="col-md-2 text-center">产品状态</th>
							<!-- <th >售卖渠道
								<a class="btn btn-link under-line" style="padding: 0px 5px; vertical-align: baseline;" ng-click="myChannel()">默认渠道</a>
							</th>
							<th style="width: 103px;">公开销售</th> -->
							<th class="col-md-2 text-center">操作</th>
							<!-- <th class="col-md-5 text-center">产品</th>
						<th class="col-md-2 text-center">产品分类</th>
						<th class="col-md-1 text-center">产品状态</th>
						<th class="col-md-1 text-center">操作</th> -->
						</tr>
					</thead>
					<tbody>
						<tr ng-repeat="obj in objs">
							<td>
								产品名称：{{obj.name_inside}}
								<br> 产品编号：{{obj.code}}
								<br> 产品分类：{{obj.sale_category_name}}
							</td>
							<td>
								分销价：<span><strong style="color: red;">{{obj.cost_price}}</strong></span> 元
								<br /> 指导价：<span><strong style="color: red;">{{obj.guide_price}}</strong></span> 元
								<br />市场价：<span>{{obj.market_price}}</span> 元
							</td>
							<td class="text-center">
								{{obj.periodstart}}
								<br />至
								<br />{{obj.periodend}}
							</td>
							<td class="text-center">
								<span ng-show="obj.sale_apply_state_name == ''">
									<br/>
								</span> {{obj.state_name}}
								<br/>
								<span ng-show="obj.sale_apply_state_name != ''" ng-bind="obj.sale_apply_state_name"></span>
							</td>
							<!-- <td>
								<div ng-if="obj.sale_apply_state != 'new'">
									<span ng-bind-html="obj.channel_list_name"></span><br ng-show="obj.channel_list_name"/>
									<a class="btn btn-xs btn-link under-line" ng-click="setChannel(obj)">设置渠道</a>
								</div>
							</td>
							<td>
								<div ng-if="obj.sale_apply_state != 'new'">
									<label class="i-switch bg-success" style="margin-left: 15px;">
										<input type="checkbox" ng-model="obj.is_selected3" ng-change="change2(obj, obj.is_selected3, $index)">
										<i></i>
									</label>
									<br>
									<a class="btn btn-xs btn-link" style="text-decoration: underline; color: rgb(41, 158, 236);" ng-click="setFxs(obj)">设置分销商</a>
								</div>
							</td> -->
							<td>
								<a ng-show="obj.state=='1'" ng-click="stop(obj.id)" class="btn btn-primary btn-xs">下架</a>
								<a ng-show="(obj.state=='0' || obj.state=='2') && obj.sale_apply_state != 'apply_sale'" ng-click="start(obj.id)" class="btn btn-danger btn-xs">申请上架</a>
								<a ng-click="edit(obj.id, obj.sale_category)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'"
								 class="btn btn-success btn-xs">编辑</a>
								<a ng-click="del(obj.id)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'" class="btn btn-danger btn-xs">删除</a>
								<a ng-show="obj.used_state=='1'" ng-click="usedstart(obj.id)" class="btn btn-primary btn-xs">允许消票</a>
								<a ng-show="obj.used_state=='0'" ng-click="usedstop(obj.id)" class="btn btn-danger btn-xs">禁止消票</a>
								<a ng-click="info(obj.id, obj.sale_category)" ng-show="obj.state == '1' || obj.sale_apply_state == 'apply_sale'" class="btn btn-warning btn-xs">详情</a>
								<a ng-show="obj.state=='1' && obj.sale_apply_state == 'for_sale'" ng-click="offSale(obj.id)" class="btn btn-danger btn-xs">禁售</a>
								<a ng-show="obj.state=='1' && obj.sale_apply_state == 'pause'" ng-click="onSale(obj.id)" class="btn btn-success btn-xs">恢复销售</a>
								<a ng-click="distribution(obj.code, obj.sale_target_type)" class="btn btn-default btn-xs" ng-show="obj.sale_target_type == 1">分配经销商</a>
								<a ng-click="skset(obj.id,obj.code,obj.name,obj.guide_price, obj.cost_price)" class="btn btn-default btn-xs" ng-show="(obj.sale_category).indexOf('S') == 0 && obj.state == 1">商客专用设置</a>

								<a ng-click="setImages(obj)" class="btn btn-default btn-xs" >设置信息</a>
								<!-- <button type="button" class="btn btn-info btn-xs" ng-click="setChannel(obj)">售卖渠道</button> -->
								<a ng-click="setPoster(obj)" class="btn btn-default btn-xs" >设置海报</a>
							</td>
							<!-- <td class="">
							产品名称：{{obj.name_inside}}<br> 产品编号：{{obj.code}}
							<br> 成本价：{{obj.cost_price}} 元 / 指导价：{{obj.guide_price}} 元 / 市场价：{{obj.market_price}} 元
						</td>
						<td class="text-center">
							<br/> {{obj.sale_category_name}}
						</td>
						<td class="text-center">
							<span ng-show="obj.sale_apply_state_name == ''"><br/></span> {{obj.state_name}}
							<br/>
							<span ng-show="obj.sale_apply_state_name != ''" ng-bind="obj.sale_apply_state_name"></span>
						</td>
						<td class="text-center">
							<a ng-show="obj.state=='1'" ng-click="stop(obj.id)" class="btn btn-primary btn-xs">下架</a>
							<a ng-show="(obj.state=='0' || obj.state=='2') && obj.sale_apply_state != 'apply_sale'" ng-click="start(obj.id)" class="btn btn-danger btn-xs">申请上架</a>
							<a ng-click="edit(obj.id, obj.sale_category)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'" class="btn btn-success btn-xs">编辑</a>
							<a ng-click="del(obj.id)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'" class="btn btn-danger btn-xs">删除</a>
							<a ng-show="obj.used_state=='1'" ng-click="usedstart(obj.id)" class="btn btn-primary btn-xs">允许消票</a>
							<a ng-show="obj.used_state=='0'" ng-click="usedstop(obj.id)" class="btn btn-danger btn-xs">禁止消票</a>
							<a ng-click="info(obj.id, obj.sale_category)" ng-show="obj.state == '1' || obj.sale_apply_state == 'apply_sale'" class="btn btn-warning btn-xs">详情</a>
							<a ng-show="obj.state=='1' && obj.sale_apply_state == 'for_sale'" ng-click="offSale(obj.id)" class="btn btn-danger btn-xs">禁售</a>
							<a ng-show="obj.state=='1' && obj.sale_apply_state == 'pause'" ng-click="onSale(obj.id)" class="btn btn-success btn-xs">恢复销售</a>
							<a ng-click="distribution(obj.code, obj.sale_target_type)" class="btn btn-default btn-xs" ng-show="obj.sale_target_type == 1">分配经销商</a>
							<a ng-click="distribution(obj.code, obj.sale_target_type)" class="btn btn-default btn-xs" ng-show="obj.sale_target_type == 0">分配不允许销售经销商</a>
							<a ng-click="skset(obj.id,obj.code,obj.name,obj.guide_price, obj.cost_price)" class="btn btn-default btn-xs" ng-show="(obj.sale_category).indexOf('S') == 0 && obj.state == 1">商客专用设置</a>

							<a ng-click="setImages(obj)" class="btn btn-default btn-xs" 
							has-permission='weshop'>设置信息</a>

							<a ng-click="setPoster(obj)" class="btn btn-default btn-xs" 
							has-permission='weshop'>设置海报</a>

						</td> -->
						</tr>
					</tbody>
				</table>
			</div>

			<div class="text-right">
				<pagination total-items="bigTotalItems" ng-model="bigCurrentPage" ng-change="load()" previous-text="上一页" next-text="下一页"
				 first-text="首页" last-text="尾页" max-size="maxSize" boundary-links="true" rotate="false" items-per-page="itemsPerPage"
				 class="m-t-none m-b">
				</pagination>
			</div>
		</div>
	</div>
	
</div>